<template>
	<view class="head">
		<view class="cell">头像</view>
		<view class="name">账号/邀请时间</view>
		<view class="cell">等级</view>
	</view>
	<scroll-view scroll-y class="scroll_view" @scrolltolower="loadmore">
		<view class="list">
			<view class="item" v-for="item in _this.list">
				<view class="avatar">
					<image :src="item.head_portrait"></image>
					<view>{{item.id}}</view>
				</view>
				<view class="item_view">
					<view class="phone">{{item.nickname}}</view>
					<view class="time">{{item.created_at}}</view>
				</view>
				<view class="status">{{item.level_name}}</view>
			</view>
		</view>
		<uv-load-more :status="_this.loadmore_status" line @loadmore="loadmore" />
	</scroll-view>
</template>

<script setup>
	import {
		userTeam
	} from "@/request/api";
	import useList from "@/hooks/useList.js";
	const {
		_this
	} = useList();
	import {
		ref
	} from "vue";
	const getList = async () => {
		let {
			list
		} = await userTeam({
			page: _this.page,
			limit: _this.limit
		});
		_this.last_page = list.last_page;
		list = list.list;
		_this.list = _this.page == 1 ? list : [..._this.list, ...list];
		_this.loadmore_status = _this.last_page == _this.page ? 'nomore' : 'loadmore';
	};
	getList();
	const loadmore = () => {
		if (_this.page >= _this.last_page) return;
		_this.page++;
		getList();
	};
</script>
<style scoped lang="scss">
	
</style>